package com.battle.pojo.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import lombok.Data;
import nirvana.core.domains.ann.AccEntity;
import nirvana.core.domains.entity.DomainBaseEntity;
import nirvana.core.domains.enums.EntityType;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 考试管理
 * @author anni.zhu
 * @author anni.zhu@king-v.com
 * Created in 2025/2/21 14:20
 */
@Data
@TableName(value = "EXAM",autoResultMap = true)
@Entity(name = "EXAM")
@AccEntity(value = "考试管理", type = EntityType.SERVICE_ENTITY)
public class Exam  extends DomainBaseEntity<Exam> {
    /**
     * 考核标题
     */
    @Column()
    private String name;

    /**
     * 是否永久
     */
    @Column()
    private Boolean isPermanent;

    /**
     * 考核开始时间
     */
    @Column()
    private LocalDateTime startTime;

    /**
     * 考核结束时间
     */
    @Column()
    private LocalDateTime endTime;

    /**
     * 状态：0未发布 1待开始 2考核中 3已完成
     */
    @Column()
    private Integer status;

    /**
     * 考核时长（分钟）
     */
    @Column()
    private Integer duration;

    /**
     * 补考次数
     */
    @Column()
    private Integer retestCount;

    /**
     * 总分数
     */
    @Column()
    private BigDecimal totalScore;

    /**
     * 平均分数=总分数/总题目数量
     */
    @Column()
    private BigDecimal averageScore;

    /**
     * 及格分数
     */
    @Column()
    private BigDecimal passScore;

    /**
     * 总题目数量
     */
    @Column()
    private Integer totalQuestionCount;

    /**
     * 单选题数量
     */
    @Column()
    private Integer singleChoiceCount;

    /**
     * 多选题数量
     */
    @Column()
    private Integer multipleChoiceCount;

    /**
     * 判断题数量
     */
    @Column()
    private Integer judgeCount;

    /**
     * 考核范围ids集合
     */
    @Column()
    private String examScopeIds;

    /**
     * 考核题库ids集合
     */
    @Column()
    private String questionBankIds;

    /**
     * 是否是随机题目
     */
    @Column()
    private Boolean isRandomQuestion;

    /**
     * 随机题目的json
     */
    @Column()
    private String randomQuestionJson;

    /**
     * 指定题目的json
     */
    @Column()
    private String appointQuestionJson;
}
